package com.lxy.ioc.Cotroller;


import com.lxy.ioc.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

@Controller
public class UserCotroller {
   /* @Autowired
    private UserService userService;*/



    /* private UserService userService;


        public UserCotroller() {
            System.out.println("无参构造");
        }

        @Autowired
        public UserCotroller(UserService userService) {
            this.userService = userService;
            System.out.println("有参构造");
        }
    */
    private UserService userService;

    @Autowired
    public void setUserService(UserService userService) {
        this.userService = userService;
    }

    public void say(){
        System.out.println("UserController say....");
        userService.say();
    }
}
